﻿@using System.Globalization
<Row>
    <Col Span="12">
    <Text>Japanese with Era</Text>
    <br />
    <DatePicker TValue="DateTimeOffset?" Locale="jaJP.DatePicker" />
    <br />
    </Col>

    <Col Span="12">
    <Text>Chinese</Text>
    <br />
    <DatePicker TValue="DateTimeOffset?" Locale="CN" CultureInfo="@CultureInfo.GetCultureInfo("zh-CN")" />
    <br />
    </Col>
</Row>

@code {
    AntDesign.Locales.Locale jaJP;

    DatePickerLocale CN = new DatePickerLocale
    {
        FirstDayOfWeek = DayOfWeek.Sunday, // it's Monday by default in built-in locale.
        DateLocale = new DateLocale
        {
            YearFormat = "yyyy年",
            MonthFormat = "M月",
            DateSelect = "选择日期",
            WeekSelect = "选择周",
            MonthSelect = "选择月份",
            YearSelect = "选择年份",
            QuarterSelect = "选择季度",
            Today = "今天"
        }
    };

    protected override void OnInitialized()
    {
        // update an exist locale
        jaJP = LocaleProvider.GetLocale("ja-JP");
        jaJP.DatePicker.DateLocale.DateFormat = "ggy年M月d日";
        jaJP.CurrentCulture.DateTimeFormat.Calendar = new JapaneseCalendar();
    }

}
